@extends('layouts.app')

@section('content')
<section class="content">

  <div class="row">
    <div class="col-md-3">
      <a href="{{ url('/api_admin/activities') }}" class="btn btn-primary btn-block margin-bottom">返回</a>
    </div>
    <div class="col-md-9">
      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title">活动详情</h3>
        </div>
        <div class="box-body no-padding">
          <img class="img-responsive" src="{{ $activity->cover }}">
          <table class="table table-bordered">
            <tr>
              <th class="col-xs-2">ID</th>
              <td class="col-xs-10">{{ $activity->id }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">主题</th>
              <td class="col-xs-10">{{ $activity->theme }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">标题</th>
              <td class="col-xs-10">{{ $activity->title }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">发布者</th>
              <td class="col-xs-10">
                <a href="{{ url('/api_admin/users/'.$activity->user_id) }}">
                  {{ $activity->user_name }}
                </a>
              </td>
            </tr>
            <tr>
              <th class="col-xs-2">开始时间</th>
              <td class="col-xs-10">{{ $activity->start_time }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">结束时间</th>
              <td class="col-xs-10">{{ $activity->end_time }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">人数</th>
              <td class="col-xs-10">{{ $activity->number_of_people }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">地址</th>
              <td class="col-xs-10">{{ $activity->address }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">详情</th>
              <td class="col-xs-10">{{ $activity->details }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">发布时间</th>
              <td class="col-xs-10">{{ $activity->created_at }}</td>
            </tr>
            <tr>
              <th class="col-xs-2">最后修改</th>
              <td class="col-xs-10">{{ $activity->updated_at }}</td>
            </tr>
            <tr>
              <th>申请人数</th>
              <td>{{ $activity->activity_apply_count }}</td>
            </tr>
            <tr>
              <th>加入人数</th>
              <td>{{ $activity->activity_join_count }}</td>
            </tr>
            <tr>
              <th>评论数</th>
              <td>{{ $activity->activity_comment_count }}</td>
            </tr>
          </table>
          <hr>
        </div>
      </div>
      <div class="box">
        <div class="box-header with-border">
          <h3 class="box-title">活动群聊记录</h3>
        </div>
        <div class="box-body">
          @foreach($comments as $comment)
          <div class="post">
            <div class="user-block">
              <img class="img-circle img-bordered-sm" src="{{ $comment->user_img }}" alt="user image">
              <span class="username">
                <a href="{{ url('/api_admin/users/'.$activity->user_id) }}">{{ $comment->user_name }}</a>
              </span>
              <span class="description">{{ $comment->created_at }}</span>
            </div>
            <!-- /.user-block -->
            <p>
              {{ $comment->comment }}
            </p>
            <!-- <ul class="list-inline">
              <li>
                <a href="#" class="link-black text-sm">
                  <i class="fa fa-trash margin-r-5 text-danger"></i> 删除
                </a>
              </li>
            </ul> -->
          </div>
          @endforeach
        </div>
        <div class="box-footer clearfix">
          {!! $comments->links() !!}
        </div>
      </div>
    </div>
  </div>
</section>
@endsection